POV-Ray : Newsgroups : povray.general : Is it possible to move a torus? : Re: Is it possible to move a torus? Server Time
5 Aug 2024 20:18:31 EDT (-0400)
  Re: Is it possible to move a torus?  
From: Dave Dunn
Date: 2 Aug 2002 12:58:37
Message: <3D4ABA1E.533A0C06@aol.com>
This may be a bit much on this subject, but here is some code showing how a
Torus macro might work. I am not happy with having to declare the variables for
the normals outside the macro, but don't have time to really think about it
right now. The cleanest way would be to just remember that normal y is 0, x is 1
and z is 2, but I wanted a clearer version for this example.

#include "colors.inc"

camera { location  <0, 1, -10> look_at 0}

light_source {<5,10,-20> White}

// This would go in the include file
#declare Y=0;
#declare X=1;
#declare Z=2;

#macro Torus(Maj,Min,Nor,Loc)
torus {Maj,Min
#switch(Nor)
#case(0)
#break
#case(1)
rotate z*90
#case(2)
rotate x*-90
#end
translate Loc}
#end

//This would go in the scene file
object {Torus(3,.2,Y,<2,2,5>)
pigment {Red}}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.